package org.gd.hellojaxb.privat24.document;

import org.gd.hellojaxb.utils.Marshall;
import org.gd.hellojaxb.utils.MarshallProperties;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "userinfo")
@XmlAccessorType(XmlAccessType.FIELD)
public class UserInfo {

    @XmlAttribute(name = "name")
    private Integer name;
    @XmlAttribute(name = "userid")
    private Integer userId;
    @XmlAttribute(name = "control")
    private String control;
    @XmlAttribute(name = "full_name")
    private String fullName;

    public UserInfo() {
    }

    public Integer getName() {
        return name;
    }

    public UserInfo setName(Integer name) {
        this.name = name;
        return this;
    }

    public Integer getUserId() {
        return userId;
    }

    public UserInfo setUserId(Integer userId) {
        this.userId = userId;
        return this;
    }

    public String getControl() {
        return control;
    }

    public UserInfo setControl(String control) {
        this.control = control;
        return this;
    }

    public String getFullName() {
        return fullName;
    }

    public UserInfo setFullName(String fullName) {
        this.fullName = fullName;
        return this;
    }

    @Override
    public String toString() {
        try {
            return Marshall.getInstance().marshal(this, MarshallProperties.WITHOUT_XML_HEADER);
        } catch (Exception e) {
            return super.toString();
        }
    }
}
